home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / comm / commo54.zip / MOSTHOST.MAC < prev    next >
Text File  |  1992-12-19  |  27KB  |  798 lines

  1.                              MOSTHOST.MAC
  2.  
  3.    Shad Muegge,
  4.    {COMMO} registration number 24,
  5.    and sysop of The Babble Underground, (707) 538-1507.
  6.  
  7. -------------------------------------------------------------------------------
  8. {:ALR} {MACL COMMO.MAC}  *  ALT-R returns to COMMO.MAC
  9. -------------------------------------------------------------------------------
  10.  
  11. {:setup}                          * Set up MOSTHOST options
  12. -------------------------------------------------------------------------------
  13. -Configuration Items--------------Description----------------------------------
  14. -------------------------------------------------------------------------------
  15.  {LIGH Y}                         Modem signal lights
  16.  {SETV dospassword,PASSWORD}      Password to access the DOS menu
  17.  {SETV filedir,%_home%MHFILE\}    Directory for file transfer files
  18.  {SETV datadir,%_home%MHDATA\}    Directory for host data files (passwords)
  19.  {SETV protodir,%_home}           Directory where DSZ, GSZ, HSLINK reside,
  20.                                     must have "\" at the end (%_home has it)
  21.  {SETV hotkeys,n}                 Hot keys (y/n)
  22.  {SETV autobaud,n}                Autobaud (set to no for locked serial port)
  23.  {SETV inact_time,120}            Inactivity timer, seconds, 0=none
  24.  {SETV attention_string,AT|}      String to get the modem's attention
  25.  {SETV ring_string,RING}          String sent from modem to indicate a ring
  26.  {SETV connect_string,CONNECT}    Result string for a successfull connection
  27. -------------------------------------------------------------------------------
  28.  
  29.         {CLEA}
  30.         {LOCA n}
  31.         {SPOC y}
  32.         {DISP 1,1,7,Setup|}
  33.         {SETE WF5}
  34.         {SEND %attention_string}            * Make sure the PARAM takes effect
  35.  
  36.         {IFEX %datadir%DATA.MHS,ST2}        * Check for data file
  37.         {SETV userno,0}
  38.         {CALL write_data}
  39. {:ST2}
  40.         {local y}
  41.         {RETURN}
  42.  
  43. --------------------------------------------* General functions ---------------
  44. {:cls}                                      * Clear the screen
  45.         {SEND ^L}
  46.         {RETURN}
  47.  
  48. {:press_any_key}                            * Pause until a key is pressed
  49.         {SEND ^J^MPress Any Key:}
  50.         {SETG %inact_time,time_out}
  51.         {GETS-H temp,1,PK}
  52. {:PK}   {setv temp}
  53.         {SEND ^J^M}
  54.         {RETURN}
  55.  
  56. {:dsp_file}                                 * Display a file
  57.         {IFEX %dump_file,,DF5}              * IN: %dump_file
  58.         {SETV count,0}
  59.         {ROPE %dump_file,DF3}
  60. {:DF1}  {READ dline}
  61.         {SEND ^M%dline^J^M}
  62.         {INCR count}
  63.         {COMP count,23}   {IFCO DF4}
  64.         {GOTO DF1}
  65. {:DF2}  {RCLOSE}
  66. {:DF3}  {SETV dline}
  67.         {SETV ch}
  68.         {SETV count}
  69.         {RETURN}
  70. {:DF4}  {SETV count,0}
  71.         {SEND ^MMore [Y],N,C: }
  72.         {CALL get_key}
  73.         {IFCO DF1}
  74.         {COMP ch,n}   {IFCO DF2}
  75.         {COMP ch,y}   {IFCO DF1}
  76.         {COMP ch,c}   {IFCO ,DF4}
  77.         {SETV count,26}
  78.         {GOTO DF1}
  79. {:DF5}  {SEND ^J^M^GError: File not found: %dump_file}
  80.         {CALL press_any_key}
  81.         {RETURN}
  82.  
  83. {:menu}                                     * Get menu selection
  84.         {SEND %prompt [%_tim]: }            * OUT: %ch
  85.         {SETG %inact_time,time_out}         * %ch = ~, if user hit CR at prompt
  86.         {CALL get_key}
  87.         {IFCO MN1}
  88.         {SEND ^J^M}
  89.         {COMP ch,*}   {IFCO time_out}
  90.         {GOTO MN2}
  91. {:MN1}  {SETV ch,~}
  92.         {SEND ^J^M}
  93. {:MN2}  {RETURN}
  94.  
  95. {:get_key}
  96.         {COMP hotkeys,y} {IFCO GK1}
  97.         {GETS ch,1}
  98.         {GOTO GK2}
  99. {:GK1}  {GETS-H ch,1}
  100. {:GK2}  {COMP ch}
  101.         {RETURN}
  102.  
  103. {:get_protocol}                             * Get protcol selection
  104.         {CALL cls}                          * OUT: %protocol
  105.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  106.         {SEND │                    Protocols                      │^J^M}
  107.         {SEND └───────────────────────────────────────────────────┘^J^M}
  108.         {SEND                     [Y] Ymodem^J^M}
  109.         {SEND                     [G] Ymodem-G^J^M}
  110.         {SEND                     [X] Xmodem^J^M}
  111.         {SEND                     [H] HS/Link^J^M^J^M}
  112.         {SEND                     [Z] Zmodem^J^M}
  113.         {SETV prompt,Protocol:}
  114.         {CALL menu}
  115.         {COMP ch,~}   {IFCO PG2}
  116.         {COMP ch,z}   {IFCO PG1}
  117.         {COMP ch,y}   {IFCO PG1}
  118.         {COMP ch,g}   {IFCO PG1}
  119.         {COMP ch,x}   {IFCO PG1}
  120.         {COMP ch,h}   {IFCO ,PG2}
  121. {:PG1}  {SETV protocol,%ch}
  122. {:PG2}  {RETURN}
  123.  
  124. {:send_hslink}                              * HSLINK download subroutine
  125.         {SEND ^J^MStart your HS/Link download now.^J^M}
  126.         {EXEC-D %protodir%HSLINK.EXE -p%_por %files -u%filedir}
  127.         {COMP %_err,0}
  128.         {RETURN}
  129.  
  130. {:send_zmodem}                              * ZMODEM download subroutine
  131.         {SEND ^J^MStart your Zmodem download now.^J^M}
  132.         {EXEC-D %protodir%%dszprog port %_por ha both sz %files}
  133.         {COMP %_err,0}
  134.         {RETURN}
  135.  
  136. {:send_ymodem}                              * YMODEM download subroutine
  137.         {SEND ^J^MStart your Ymodem download now.^J^M}
  138.         {SYMO-K %files}
  139.         {COMP %_err,0}
  140.         {RETURN}
  141.  
  142. {:send_xmodem}                              * XMODEM-1K download subroutine
  143.         {SEND ^J^MStart your Xmodem download now.^J^M}
  144.         {IFEX %files,,SX1}
  145.         {SXMO-K %files}
  146.         {COMP %_err,0}
  147. {:SX1}  {RETURN}
  148.  
  149. {:recv_hslink}                              * HSLINK upload subroutine
  150.         {SEND ^J^MStart your HS/Link upload now.^J^M}
  151.         {EXEC-D %protodir%HSLINK.EXE -p%_por -u%filedir}
  152.         {COMP %_err,0}
  153.         {RETURN}
  154.  
  155. {:recv_zmodem}                              * ZMODEM upload subroutine
  156.         {SEND ^J^MStart your Zmodem upload now.^J^M}
  157.         {EXEC-D %protodir%%dszprog port %_por ha both rz %files}
  158.         {COMP %_err,0}
  159.         {RETURN}
  160.  
  161. {:recv_ymodem}                              * YMODEM upload subroutine
  162.         {SEND ^J^MStart your Ymodem upload now.^J^M}
  163.         {RYMO %files}
  164.         {COMP %_err,0}
  165.         {RETURN}
  166.  
  167. {:recv_yg}                                  * YMODEM-G upload subroutine
  168.         {SEND ^J^MStart your Ymodem-G upload now.^J^M}
  169.         {RYMO-G %files}
  170.         {COMP %_err,0}
  171.         {RETURN}
  172.  
  173. {:recv_xmodem}                              * XMODEM-1K upload subroutine
  174.         {SEND ^J^MStart your Xmodem upload now.^J^M}
  175.         {RXMO-Y %files}
  176.         {COMP %_err,0}
  177.         {RETURN}
  178.  
  179. {:transfer_file}                            * Transfer a file upload & download
  180.         {PUSH DL2}
  181.         {COMP proto,sz} {IFCO send_zmodem}  * IN: %proto
  182.         {COMP proto,sy} {IFCO send_ymodem}  *   s + %protocol for downloads
  183.         {COMP proto,sg} {IFCO send_ymodem}  *   r + %protocol for uploads
  184.         {COMP proto,sx} {IFCO send_xmodem}
  185.         {COMP proto,sh} {IFCO send_hslink}
  186.         {COMP proto,rz} {IFCO recv_zmodem}
  187.         {COMP proto,ry} {IFCO recv_ymodem}
  188.         {COMP proto,rg} {IFCO recv_yg}
  189.         {COMP proto,rx} {IFCO recv_xmodem}
  190.         {COMP proto,rh} {IFCO recv_hslink}
  191.         {SEND ^J^MInvalid protocol ^J^M}
  192.         {CALL press_any_key}
  193.         {COMP proto,sz}                     * Set a bad condition for return
  194. {:DL1}  {SETV proto}
  195.         {POPS}
  196.         {RETURN}
  197. {:DL2}  {PAUS 2}
  198.         {RETURN}
  199.  
  200. {:get_name}
  201. {:GN1}  {SEND ^J^MEnter your real name: }   * Get a name from user
  202.         {SETG %inact_time,time_out}         * OUT: %lname
  203.         {GETS lname,16,GN1}
  204.         {RETURN}
  205.  
  206. {:get_password}                             * Get a password
  207.         {SETG %inact_time,time_out}
  208. {:GP1}  {GETS-P pass,8}
  209.         {RETURN}
  210.  
  211. {:time_out}                                 * Time out user
  212.         {POPS-C}                            * Clear the stack
  213.         {GOTO gby}
  214.  
  215. {:write_user}                               * Write the user file
  216.         {WOPE %datadir%%password.MHS}       * IN: %login_name
  217.         {WRIT %login_name}                  * IN: %userno
  218.         {WRIT %userno}                      * IN: %new_start
  219.         {WRIT %new_start}                   * IN: %protocol
  220.         {WRIT %protocol}
  221.         {WCLO}
  222.         {RETURN}
  223.  
  224. {:read_user}                                * Read the user file
  225.         {ROPE %datadir%%password.MHS,RU1}   * OUT: %login_name
  226.         {READ %login_name}                  * OUT: %userno
  227.         {READ %userno}                      * OUT: %new_start
  228.         {READ %new_start}                   * OUT: %protocol
  229.         {READ %protocol}
  230.         {RCLOSE}
  231. {:RU1}  {RETURN}
  232.  
  233. {:write_data}                               * Write data file
  234.         {WOPE %datadir%DATA.MHS}            * IN: %userno
  235.         {WRIT %userno}                      * IN: %mhigh
  236.         {WRIT %mhigh}
  237.         {WCLO}
  238.         {RETURN}
  239.  
  240. {:read_data}                                * Read data file
  241.         {ROPE %datadir%DATA.MHS,RD1}        * OUT: %userno
  242.         {READ %userno}                      * OUT: %mhigh
  243.         {READ %mhigh}
  244.         {RCLO}
  245. {:RD1}  {RETURN}
  246.  
  247. --------------------------------------------* Login functions -----------------
  248.  
  249. {:new_user}                                 * Get new user information
  250.         {CALL cls}                          * OUT: %login_name
  251. {:NU4}                                      * OUT: %password
  252.                                             * OUT: %userno
  253.         {SEND Welcome to the host with the most.  Enter your name and password.^J^M}
  254. {:NU0}  {CALL get_name}                     * OUT: %new_start
  255.         {SETV login_name,%lname}            * OUT: %protocol
  256.         {SETV lname}
  257.  
  258. {:NU1}  {SEND ^J^MEnter your password: }
  259.         {GETS password,8,NU0}
  260.         {IFEX %datadir%%password.MHS,,NU3}
  261.         {SEND ^J^MInvalid password, try something different.}
  262.         {GOTO NU1}
  263.  
  264. {:NU3}  {INCR userno}
  265.  
  266.         {SETV new_start,1}
  267.         {CALL get_protocol}
  268.         {SEND ^J^MSaving user information.}
  269.         {CALL write_user}
  270.         {SEND ^J^MRe-enter your name and password for verification.}
  271.         {RETURN}
  272.  
  273. {:login_user}                               * Login user
  274.         {PUSH}                              * OUT: %SUCCESS
  275.         {SETV SUCCESS}                      * OUT: %login_name
  276.         {SETV tries,0}                      * OUT: %password
  277. {:LU0}  {INCR tries}                        * OUT: %userno
  278.         {COMP tries,3}  {IFCO-G LU4}        * OUT: %new_start
  279.                                             * OUT: %protocol
  280.         {SEND ^J^Mlogin: }
  281.         {SETG %inact_time,time_out}
  282.         {GETS lname,16,LU0}
  283.  
  284.         {COMP lname,new}  {IFCO new_user}
  285.  
  286.         {SEND ^J^Mpassword: }
  287.         {CALL get_password}
  288.         {SETV password,%pass}
  289. {:LU2}  {SEND ^J^M}
  290.         {IFEX %datadir%%password.MHS,,LU0}
  291.         {CALL read_user}
  292.         {COMP login_name,%lname}
  293.         {IFCO ,LU0}
  294.  
  295.         {SETV SUCCESS,true}
  296.  
  297. {:LU4}  {SETV tries}
  298.         {SETV lname}
  299.         {SETV pass}
  300.         {POPS}
  301.         {RETURN}
  302.  
  303. --------------------------------------------* Dos functions--------------------
  304.  
  305. {:change_dir}                               * Change Dir
  306.         {SEND ^J^MCD }
  307.         {SETG %inact_time,time_out}
  308.         {GETS cd,70,CD1}
  309.         {EXEC-N CD %cd}
  310. {:CD1}  {SETV cd}
  311.         {RETURN}
  312.  
  313. {:do_dir}                                   * Directory
  314.         {CALL cls}
  315.         {SEND ^J^MDIR }
  316.         {SETG %inact_time,time_out}
  317.         {GETS dir,70}
  318.         {EXEC-N DIR %dir > %datadir%DIR.TMP}
  319.         {SETV dump_file,%datadir%DIR.TMP}
  320.         {CALL dsp_file}
  321.         {CALL press_any_key}
  322.         {SETV dir}
  323.         {RETURN}
  324.  
  325. {:type_file}                                * Type a file
  326.         {CALL cls}
  327.         {SEND ^J^MTYPE }
  328.         {SETG %inact_time,time_out}
  329.         {GETS type,70,TF1}
  330.         {SEND ^J^M}
  331.         {SETV dump_file,%type}
  332.         {CALL dsp_file}
  333.         {CALL press_any_key}
  334. {:TF1}  {SETV type}
  335.         {RETURN}
  336.  
  337. {:erase_file}                               * Erase a file
  338.         {SEND ^J^M^J^M(CR to abort)}
  339.         {SEND ^J^MERASE }
  340.         {SETG %inact_time,time_out}
  341.         {GETS erase,70,EF1}
  342.         {COMP erase,*.*}
  343.         {IFCO ,EF4}
  344.         {SEND ^J^M*.* not allowed!}
  345.         {CALL press_any_key}
  346.         {GOTO EF1}
  347. {:EF4}  {IFEX %erase,,EF2}
  348.         {SEND ^J^MErase %erase (Y/N): }
  349. {:EF3}  {CALL get_key}
  350.         {IFCO EF3}
  351.         {COMP ch,y} {IFCO ,erase_file}
  352.         {EXEC-N ERASE %erase > nul}
  353.         {GOTO EF1}
  354. {:EF2}  {SEND ^J^MFile not found.}
  355.         {GOTO erase_file}
  356. {:EF1}  {SETV erase}
  357.         {RETURN}
  358.  
  359. {:copy_file}                                * Copy a file
  360.         {SEND ^J^MCOPY }
  361.         {SETG %inact_time,time_out}
  362.         {GETS copy,70,CF1}
  363.         {EXEC-N COPY %copy > nul}
  364. {:CF1}  {SETV copy}
  365.         {RETURN}
  366.  
  367. {:rename_file}                              * Rename a file
  368.         {SEND ^J^MREN }
  369.         {SETG %inact_time,time_out}
  370.         {GETS ren,70,RF1}
  371.         {EXEC-N REN %ren > nul}
  372. {:RF1}  {SETV ren}
  373.         {RETURN}
  374.  
  375. {:exit_to_dos}                              * Exit to dos with DOORWAY.EXE
  376.         {COMP mspeed,local}
  377.         {IFCO EX1}
  378.         {EXEC DOORWAY PORT:%_pad:%_irq /M:60 /G:ON /A:ON /V:D^U /O:T /S:* /C:DOS}
  379.         {GOTO EX2}
  380. {:EX1}  {SHELL}
  381. {:EX2}  {RETURN}
  382.  
  383. {:dos_download}                             * Download a file
  384.         {SETV proto}                        * IN: %protocol
  385.         {COMP protocol,}
  386.         {IFCO ,DD1}
  387.         {CALL get_protocol}
  388. {:DD1}  {SEND ^J^MFile: }
  389.         {SETG %inact_time,time_out}
  390.         {GETS files,70,DD2}
  391.         {SETV proto,s%protocol}
  392.         {SETV save_filedir,%filedir}
  393.         {SETV filedir}
  394.         {CALL transfer_file}
  395.         {CALL cls}
  396.         {SETV filedir,%save_filedir}
  397.         {SETV save_filedir}
  398.         {IFCO DD2}
  399.         {SEND ^J^MUnsuccessfull download}
  400.         {CALL press_any_key}
  401. {:DD2}  {SETV files}
  402.         {RETURN}
  403.  
  404. {:dos_upload}                               * Upload a file
  405.         {SETV proto}                        * IN: %protocol
  406.         {COMP protocol,}
  407.         {IFCO ,DU1}
  408.         {CALL get_protocol}
  409. {:DU1}  {COMP protocol,x}
  410.         {IFCO ,DU2}
  411.         {SEND ^J^MFile: }
  412.         {SETG %inact_time,time_out}
  413.         {GETS files,70,DU3}
  414. {:DU2}  {SETV proto,r%protocol}
  415.         {SETV save_filedir,%filedir}
  416.         {SETV filedir}
  417.         {CALL transfer_file}
  418.         {CALL cls}
  419.         {SETV filedir,%save_filedir}
  420.         {SETV save_filedir}
  421.         {IFCO DU3}
  422.         {SEND ^J^MUnsuccessfull upload}
  423.         {CALL press_any_key}
  424. {:DU3}  {SETV files}
  425.         {RETURN}
  426.  
  427. {:log_drive}                                * Log a drive
  428.         {SEND ^J^MChange to which drive (A:, B:, C:, etc): }
  429.         {SETG %inact_time,time_out}
  430.         {GETS log,2,LD2}
  431. {:LD1}  {SEND ^J^MChange to drive %log (Y/N)? }
  432.         {SETG %inact_time,time_out}
  433.         {CALL get_key}
  434.         {IFCO LD1}
  435.         {COMP ch,n}  {IFCO LD2}
  436.         {COMP ch,y}  {IFCO ,LD1}
  437.         {EXEC-N %log}
  438. {:LD2}  {SETV log}
  439.         {RETURN}
  440.  
  441. {:dos_stuff}                                * Dos Menu
  442.         {SEND ^J^MDos password: }
  443.         {CALL get_password}
  444.         {COMP pass,%dospassword}
  445.         {IFCO ,DS3}
  446.         {PUSH}
  447. {:DS1}
  448.         {CALL cls}
  449.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  450.         {SEND │                   DOS Commands                    │^J^M}
  451.         {SEND └───────────────────────────────────────────────────┘^J^M}
  452.         {SEND  [A] Log New Drive^J^M}
  453.         {SEND  [C] Change Dir       [U] Upload to current dir^J^M}
  454.         {SEND  [D] Directory        [V] Download from current dir^J^M}
  455.         {SEND  [E] Erase File^J^M}
  456.         {SEND  [K] Copy File        [Z] Run DOORWAY program (shell^J^M}
  457.         {SEND  [T] Type File            to DOS in local mode)^J^M}
  458.         {SEND  [R] Rename File^J^M^J^M}
  459.         {SETV prompt,DOS (CR to return)}
  460.         {CALL menu}
  461.  
  462.         {COMP ch,~}   {IFCO DS2}
  463.         {COMP ch,a}   {IFCO log_drive}
  464.         {COMP ch,c}   {IFCO change_dir}
  465.         {COMP ch,d}   {IFCO do_dir}
  466.         {COMP ch,e}   {IFCO erase_file}
  467.         {COMP ch,k}   {IFCO copy_file}
  468.         {COMP ch,r}   {IFCO rename_file}
  469.         {COMP ch,t}   {IFCO type_file}
  470.         {COMP ch,u}   {IFCO dos_upload}
  471.         {COMP ch,v}   {IFCO dos_download}
  472.         {COMP ch,z}   {IFCO exit_to_dos}
  473.  
  474.         {GOTO DS1}
  475. {:DS2}  {POPS}
  476. {:DS3}  {SETV pass}
  477.         {SETV prompt}
  478.         {RETURN}
  479.  
  480. --------------------------------------------* Xfer functions-------------------
  481.  
  482. {:dfiles}                                   * Download a file
  483.         {SETV proto}                        * IN/OUT: %protocol
  484.         {COMP protocol,}
  485.         {IFCO ,DX1}
  486.         {CALL get_protocol}
  487. {:DX1}  {SEND ^J^MFile: }
  488.         {SETG %inact_time,time_out}
  489.         {GETS files,70,DX2}
  490.         {SETV files,%filedir%%files}
  491.         {SETV proto,s%protocol}
  492.         {CALL transfer_file}
  493.         {CALL cls}
  494.         {IFCO DX2}
  495.         {SEND ^J^MUnsuccessfull download}
  496.         {CALL press_any_key}
  497. {:DX2}  {SETV files}
  498.         {RETURN}
  499.  
  500. {:ufiles}                                   * Upload a file
  501.         {SETV proto}                        * IN/OUT: %protocol
  502.         {SETV files,%filedir}
  503.         {COMP protocol,}
  504.         {IFCO ,UF1}
  505.         {CALL get_protocol}
  506. {:UF1}  {COMP protocol,x}
  507.         {IFCO ,UF2}
  508.         {SEND ^J^MFile: }
  509.         {SETG %inact_time,time_out}
  510.         {GETS dfiles,70,UF3}
  511.         {SETV files,%files%%dfiles}
  512.         {IFEX %files,,UF2}
  513.         {SEND ^J^MFile already exists!^J^M}
  514.         {CALL Press_Any_Key}
  515.         {GOTO UF3}
  516. {:UF2}  {SETV proto,r%protocol}
  517.         {CALL transfer_file}
  518.         {CALL cls}
  519.         {IFCO UF3}
  520.         {SEND ^J^MUnsuccessfull upload}
  521.         {CALL press_any_key}
  522. {:UF3}  {SETV files}
  523.         {SETV dfiles}
  524.         {RETURN}
  525.  
  526. -------------------------------------------------------------------------------
  527.  
  528. {:chat}                                      * Chat w/word wrap
  529.         {SETG inact_time,time_out}
  530.         {BEEP} {BEEP} {BEEP}
  531.         {SETV chatc,3}
  532.         {SEND ^J^M^J^M(Type 'bye' to exit chat mode)^J^M}
  533.         {SEND ^J^M1> Hi %login_name, what's up?}
  534.         {SEND ^J^M2>}
  535. {:CT1}  {SETV chatl}
  536. {:CT2}  {SEND ^J^M%chatc> %chatl}
  537.         {INCR chatc}
  538.         {GETS-AH chatl,70}
  539.         {COMP chatl,bye}  {IFCO CT5}
  540.         {LENGTH %chatl}
  541.         {COMP %_len,69}  {IFCO-LE CT1}
  542.         {SETV x,71}
  543. {:CT3}  {DECR x}
  544.         {COMP x,50}  {IFCO-LE CT1}
  545.         {SUBS ch,%x,1,%chatl}
  546.         {COMP ch, }       {IFCO ,CT3}
  547.         {INCR x}
  548.         {SUBS chatl,%x,255,%chatl}
  549. {:CT4}  {COMP x,%_len}  {IFCO-G CT2}
  550.         {SEND ^H ^H}
  551.         {INCR x}
  552.         {GOTO CT4}
  553. {:CT5}  {RETURN}
  554.  
  555. -------------------------------------------------------------------------------
  556.  
  557. {:time_online}                              * Elapsed time
  558.         {SEND ^J^MTime online: %_elap minutes^J^M}
  559.         {CALL Press_Any_Key}
  560.         {RETURN}
  561.  
  562. --------------------------------------------* User info------------------------
  563.  
  564. {:chg_name}                                 * Get new login name
  565.         {SEND ^J^M}                         * OUT: %lname
  566. {:CN1}  {CALL get_name}
  567.         {RETURN}
  568.  
  569. {:chg_password}                             * Get new password
  570.         {SEND ^J^M}                         * OUT: %pass
  571. {:CP1}  {SEND ^J^MNew password: }
  572.         {SETG %inact_time,time_out}
  573.         {GETS pass,8,CP1}
  574.  
  575.         {COMP pass,%password}   {IFCO CP2}
  576.  
  577.         {IFEX %datadir%%pass.MHS,,CP2}
  578.         {SEND ^J^MInvalid password, try again.}
  579.         {GOTO CP1}
  580.  
  581. {:CP2}  {RETURN}
  582.  
  583. {:chg_protocol}                             * Get new protocol
  584.         {CALL cls}                          * OUT: %protocol
  585.         {CALL get_protocol}
  586.         {RETURN}
  587.  
  588. {:save_user}                                * Save new information
  589.         {SEND ^J^MSaving}                   * IN: %lname,%pass,%protocol
  590.         {IFEX %datadir%%password.MHS,,SU1}  * OUT: %login_name,%password
  591.         {EXEC-N DEL %datadir%%password.MHS} * OUT: %new_start,%uport
  592. {:SU1}  {SETV login_name,%lname}
  593.         {SETV password,%pass}
  594.         {SETV uprot,%protocol}
  595.         {CALL write_user}
  596.         {RETURN}
  597.  
  598. {:fil_dir}
  599.         {EXEC-N DIR %filedir%*.* > %datadir%DIR.TMP}
  600.         {SETV dump_file,%datadir%DIR.TMP}
  601.         {CALL dsp_file}
  602.         {CALL press_any_key}
  603.         {RETURN}
  604.  
  605. {:update_info}                              * User info menu
  606.         {SETV lname,%login_name}
  607.         {SETV pass,%password}
  608.         {SETV uprot,%protocol}
  609.         {PUSH}
  610. {:UI1}  {CALL cls}
  611.         {SEND ^J^M}
  612.         {SEND ^J^M1.  User name: %lname}
  613.         {SEND ^J^M2.   Password: %pass}
  614.         {SEND ^J^M3.   Protocol: %protocol}
  615.         {SEND ^J^M}
  616.         {SEND ^J^MCommand (CR to return) [%_tim]: }
  617.         {SETG %inact_time,time_out}
  618.         {CALL get_key}
  619.         {IFCO UI2}
  620.  
  621.         {COMP ch,1}  {IFCO chg_name}
  622.         {COMP ch,2}  {IFCO chg_password}
  623.         {COMP ch,3}  {IFCO chg_protocol}
  624.         {GOTO UI1}
  625.  
  626. {:UI2}  {SEND ^J^MSave changes (Y/N)? }
  627.         {CALL get_key}
  628.         {IFCO UI3}
  629.         {COMP ch,n} {IFCO UI3}
  630.         {COMP ch,y} {IFCO ,UI2}
  631.         {CALL save_user}
  632. {:UI3}  {POPS}
  633.         {SETV ch}
  634.         {SETV lname}
  635.         {SETV pass}
  636.         {SETV protocol,%uprot}
  637.         {RETURN}
  638.  
  639. -------------------------------------------------------------------------------
  640.  
  641. {:main_menu}                                * Main menu
  642.         {PUSH}
  643. {:MM1}
  644.         {CALL cls}
  645.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  646.         {SEND │                    Main Menu                      │^J^M}
  647.         {SEND └───────────────────────────────────────────────────┘^J^M}
  648.         {SEND       [D] Download Files        [T] Time online^J^M}
  649.         {SEND       [U] Upload Files          [G] Goodbye^J^M}
  650.         {SEND       [F] File List             [S] DOS Menu^J^M}
  651.         {SEND       [C] Chat                  [I] User Info^J^M}
  652.         {SEND       [P] Protocol (%protocol)^J^M^J^M}
  653.         {SETV prompt,Main Menu}
  654.         {CALL menu}
  655.  
  656.         {COMP ch,c}   {IFCO chat}
  657.         {COMP ch,f}   {IFCO fil_dir}
  658.         {COMP ch,s}   {IFCO dos_stuff}
  659.         {COMP ch,g}   {IFCO MM3}
  660.         {COMP ch,t}   {IFCO time_online}
  661.         {COMP ch,i}   {IFCO update_info}
  662.         {COMP ch,d}   {IFCO dfiles}
  663.         {COMP ch,p}   {IFCO get_protocol}
  664.         {COMP ch,u}   {IFCO ufiles}
  665.         {GOTO MM1}
  666.  
  667. {:MM3}  {SEND ^J^MAre you sure (Y/N)? }
  668.         {CALL get_key}
  669.         {IFCO MM1}
  670.         {COMP ch,y}   {IFCO ,MM1}
  671.  
  672. {:MM2}  {POPS}
  673.         {RETURN}
  674.  
  675. --------------------------------------------* Waiting for a call funcs--------
  676.  
  677. {:view_scroll}
  678.         {SCROLL}
  679.         {GOTO wait_for_call}
  680.  
  681. {:shell_dos}
  682.         {SHELL}
  683.         {GOTO wait_for_call}
  684.  
  685. {:wait_for_call}
  686.         {SPOC n}
  687.         {CLEAR}
  688.         {DISP 1, 1,4E,                                  HOST MODE                                     }
  689.  
  690.         {DISP 3, 1,0E,                                       The Host with the Most}
  691.         {DISP 4, 1,0E,  1 - Login locally                          By Shad Muegge}
  692.         {DISP 5, 1,0E,  2 - View Scrollback
  693.         {DISP 6, 1,0E,  3 - Shell to DOS                            ____}
  694.         {DISP 7, 1,0E,                                    -------^|\/ o  \------------------}
  695.         {DISP 8, 1,0E,  Q - Quit                             ____^|    ,__^| Association of}
  696.         {DISP 9, 1,0E,                                      /  o \/^|____/  Babble Fish}
  697.         {DISP 10,1,0E,                                     ^|__,    ^|____   Programmers}
  698.         {DISP 11,1,0E,                                      \____^|\/ o  \}
  699.         {DISP 12,1,0E,                                           ^|    ,__^| MEMBER}
  700.         {DISP 13,1,0E,                                    -------^|/\____/------------------}
  701.  
  702.         {DISP 20,1,0E,  Last user: %login_name (%mspeed)}
  703.  
  704. {:WF0}  {DISP 23,30,4e, Waiting for a Call }
  705.         {DISP 15,1,,                               }
  706.         {DISP 15,1,0E,  Command: }
  707.         {SETG ,,l}
  708. {:WF1}  {GETS mring,10,WF1}
  709.         {DISP 23,30,07,                    }
  710.         {COMP mring,1}              {IFCO WF4}
  711.         {COMP mring,2}              {IFCO view_scroll}
  712.         {COMP mring,3}              {IFCO shell_dos}
  713.         {COMP mring,q}              {IFCO WF5}
  714.         {COMP mring,%ring_string}   {IFCO ,WF0}
  715.  
  716.         {SPOC y}
  717.         {SEND ~ATA^M~}
  718.  
  719.         {SETL 45,wait_for_call}
  720.         {DISP 17,1,7,  Waiting for connect: }
  721.         {COMP autobaud,y}   {IFCO WF2}
  722.         {LOOK %connect_string}
  723.         {PAUS 1}
  724.         {RETURN}
  725.  
  726. {:WF2}  {GOLO C012,%connect_string 1200^M}
  727.         {GOLO C024,%connect_string 2400^M}
  728.         {GOLO C048,%connect_string 4800^M}
  729.         {GOLO C096,%connect_string 9600^M}
  730.         {GOLO C192,%connect_string 19200^M}
  731.         {GOLO C384,%connect_string 38400^M}
  732.         {LOOK %connect_string^M}
  733.         {SETV mspeed,300}
  734.         {GOTO WF3}
  735.  
  736. {:C012} {SETV mspeed,1200}  {GOTO WF3}
  737. {:C024} {SETV mspeed,2400}  {GOTO WF3}
  738. {:C048} {SETV mspeed,4800}  {GOTO WF3}
  739. {:C096} {SETV mspeed,9600}  {GOTO WF3}
  740. {:C192} {SETV mspeed,19200} {GOTO WF3}
  741. {:C384} {SETV mspeed,38400}
  742.  
  743. {:WF3}  {PARM %mspeed}
  744.         {PAUS 1}
  745.         {RETURN}
  746.  
  747. {:WF4}  {SETV mspeed,LOCAL}
  748.         {local y}
  749.         {SPOC n}
  750.         {RETURN}
  751.  
  752. {:WF5}  {CLEAR}
  753.      Clean up variables
  754.  
  755.         {SETV userno}     {SETV mring}      {SETV filedir}   {SETV mspeed}
  756.         {SETV new_start}  {SETV login_name} {SETV password}  {SETV dump_file}
  757.         {SETV password}   {SETV protocol}   {SETV prompt}    {SETV ch}
  758.         {SETV datadir}    {SETV dospassw}   {SETV protodir}  {SETV autobaud}
  759.         {SETV mhigh}      {SETV chatc}      {SETV chatl}     {SETV x}
  760.         {SETV inact_time} {SETV proto}      {SETV uprot}     {SETV hotkeys}
  761.         {SETV connect_string}  {SETV attention_string}  {SETV ring_string}
  762.  
  763.         {LOCA n}
  764.         {MACL COMMO.MAC}
  765.  
  766. --------------------------------------------* Main BBS loop ------------------
  767.  
  768. {:BBS}
  769.         {CALL setup}
  770.         {CALL Wait_For_Call}
  771.  
  772.         {CALL cls}
  773.         {SETV userno}
  774.         {SEND ^J^M                                  HOST MODE^J^M^J}
  775.         {SEND                        Written in ^(COMMO^) macro language^J^M^J^J}
  776.         {SEND New users type 'NEW'^J^M^J^M}
  777.         {CALL read_data}
  778.         {CALL login_user}
  779.  
  780.         {COMP success,TRUE}
  781.         {IFCO ,gby}
  782.  
  783. {:BB0}  {ELAP}
  784.         {CALL main_menu}
  785.  
  786. {:gby}
  787.         {SEND ^J^M^JThanks for calling...^J^M}
  788.         {HANG y}
  789.         {COMP success,TRUE}
  790.         {IFCO ,hng}
  791.         {SEND Saving}
  792.         {CALL write_user}
  793.         {CALL write_data}
  794. {:hng}  {SETV success}
  795.         {GOTO BBS}
  796.  
  797.                                 - end -
  798.